package com.qf.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.dao.TestpaperDao;
import com.qf.entity.TbTestpaperQuestion;
import com.qf.service.TestpaperService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestpaperServiceImpl extends ServiceImpl<TestpaperDao, TbTestpaperQuestion> implements TestpaperService {

    @Autowired(required = false)
    ResultMsg resultMsg;

    @Autowired(required = false)
    TestpaperDao testpaperDao;

    @Override
    public ResultMsg addTestPaper(TbTestpaperQuestion tbTestpaperQuestion) {
        int insert = testpaperDao.insert(tbTestpaperQuestion);
        if (insert==1)
            return resultMsg.success();
        return resultMsg.faild(300,"添加到试卷失败");
    }
}
